public class Person {
    private String name;
    private int age;
    private Dog pet;

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public void sayHello() {
        System.out.println("Hello, my name is " + name);
    }

    public void celebrateBirthday() {
        age++;
        System.out.println("Happy birthday! Now I am " + age + " years old");
    }

    public void adoptDog(Dog dog) {
        this.pet = dog;
        System.out.println(name + " has adopted a dog named " + dog.getName());
    }

    public String getName() {
        return name;
    }

    public static void main(String[] args) {
        Person person = new Person("Alice", 28);
        person.sayHello();
        person.celebrateBirthday();
    }
}
